﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace JieBooLaw.WebSite
{
    using JieBooLaw.Service;
    using JieBooLaw.Domain;
    using JieBooLaw.Common.Web.Util;
    using System.Text;
    using System.Data;
    public partial class Index : System.Web.UI.Page
    {
        public List<TInfoRelease_Info> Attention;
        public List<TInfoRelease_Info> ClassicCase;
        public List<TInfoRelease_Info> LitigationGuide;
        public List<TInfoRelease_Info> DynamicNews;
        public List<TInfoRelease_Info> LegalAdviser;
        public List<TInfoRelease_Info> CompanyPractices;
        public List<TInfoRelease_Info> CriminalDefense;
        public List<TInfoRelease_Info> TortCompensation;
        public List<TInfoRelease_Info> Inheritance;
        public List<TInfoRelease_Info> LaborArbitration;
       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
            }
        }
        private void BindGrid()
        {
            TInfoRelease_InfoSvc svc = new TInfoRelease_InfoSvc();
            IList<TInfoRelease_Info> entity = svc.GetAllList();
            //热点关注
            Attention =   (from actten in entity  orderby actten.CreatedDate  descending  where actten.ItemID.Equals(3) select actten).ToList<TInfoRelease_Info>();
            //经典案例
            ClassicCase = (from actten in entity  orderby actten.CreatedDate  descending  where actten.ItemID.Equals(4) select actten).ToList<TInfoRelease_Info>();
            //诉讼指南
            LitigationGuide = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(5) select actten).ToList<TInfoRelease_Info>();
            //动态新闻
            DynamicNews = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(6) select actten).ToList<TInfoRelease_Info>();
            //法律顾问
            LegalAdviser = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(56) select actten).ToList<TInfoRelease_Info>();
            //公司实务
            CompanyPractices = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(8) select actten).ToList<TInfoRelease_Info>();
            //刑事辩护
            CriminalDefense = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(9) select actten).ToList<TInfoRelease_Info>();
            //侵权赔偿
            TortCompensation = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(10) select actten).ToList<TInfoRelease_Info>();
            //遗产继承
            Inheritance = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(11) select actten).ToList<TInfoRelease_Info>();
            //劳动仲裁
            LaborArbitration = (from actten in entity orderby actten.CreatedDate descending where actten.ItemID.Equals(12) select actten).ToList<TInfoRelease_Info>();
        }

 
    }
}
